//
// Created by 11067 on 2023/3/6.
//

#ifndef WORD_LIST_CORE_UTILS_H
#define WORD_LIST_CORE_UTILS_H

#include <string>
#include <vector>
#include <set>
#include <fstream>
#include <sstream>
#include "../exceptions/WordListException.h"

inline bool is_alpha(char c) {
    return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}
inline bool is_ascii(char c) {
    return (c & 0b10000000) == 0;
}
inline bool is_space(char c) {
    //return c == '\r' || c == '\n' || c == '\t' || c == ' ' || c == '\v' || c == '\f';
    return !is_alpha(c);
}
inline bool is_lower(char c) {
    return c >= 'a' && c <= 'z';
}

//int str2words(std::string& str_in, std::set<std::string>& words);



int file2wordlist(std::string file, std::vector<std::string>& wordlist);

int file2str(std::string file, std::string& str);

void trim(std::string& str);


#endif //WORD_LIST_CORE_UTILS_H
